﻿using UnityEngine;

namespace BridgeShips {
    /// <summary>
    /// 资源路径
    /// </summary>
    /// 
    public class AssetPath {
        /// <summary>
        /// Assetbundle路径
        /// </summary>
        public static string AssetBundlePath {
            get {
                switch (Application.platform) {
                    case RuntimePlatform.WindowsEditor:
                    case RuntimePlatform.WindowsPlayer:
                        return string.Format( "{0}/{1}", Application.streamingAssetsPath, PlatformDirectory );
                    case RuntimePlatform.IPhonePlayer:
                    case RuntimePlatform.Android:
                        return string.Format( "{0}/{1}", Application.persistentDataPath, PlatformDirectory );
                }
                return null;
            }
        }
        /// <summary>
        /// 平台的相对路径
        /// </summary>
        public static string PlatformDirectory {
            get {
                switch (Application.platform) {
                    case RuntimePlatform.WindowsEditor:
                    case RuntimePlatform.WindowsPlayer:
                        return "Windows";
                    case RuntimePlatform.IPhonePlayer:
                        return "IPhone";
                    case RuntimePlatform.Android:
                        return "Android";
                }
                return null;
            }
        }
        /// <summary>
        /// Manifest文件路径
        /// </summary>
        public static string ManifestPath {
            get {
                return string.Format( "{0}/{1}", AssetBundlePath, PlatformDirectory );
            }
        }
        /// <summary>
        /// AssetBundle后缀名
        /// </summary>
        public static string BundleExtensionName = ".ab";
    }
}